// 接口都放在这里
import http from "./axios"
// 删除菜单
export const delMenuById = (id) => http.post('/menudelete', {id})
// 新增菜单
export const addMenu = (data) => http.post('/menuadd', data)
// 编辑菜单
export const editMenu = (data) => http.post('/menuedit', data)
// 获取角色列表
export const getRoleList = () => http('/rolelist')
// 新增角色
export const addRole = (data) => http.post('/roleadd', data)
// 编辑角色
export const editRole = (data) => http.post('/roleedit', data)
// 删除角色
export const delRoleById = (id) => http.post('/roledelete', {id})
// 获取管理员总数
export const getUserCount = () => http.get('/usercount')
// 获取管理员列表
export const getUserList = (data) => http.get('/userlist', {params: data})
// 新增管理员
export const addUser = (data) => http.post('/useradd', data)
// 后台管理员登录
export const userLogin = (data) => http.post('/userlogin', data)
// 获取树形商品分类列表
export const getCateListTree = () => http('/catelist', {params: {istree: 1}})
// 修改商品分类
export const editCate = (data) => http.post('/cateedit', data)
// 获取商品规格列表
export const getSpecsList = () => http('/specslist', {params: {page: 1, size: 99}})
// 新增商品规格
export const addSpecs = (data) => http.post('/specsadd', data)
// 获取商品列表
export const getGoodsList = () => http('/goodslist', {params: {page: 1, size: 99}})
// 根据上级分类 获取下级分类
export const getCateListByTop = (data) => http('/catelist', {params: data})
